package com.ssm.service.impl;

import com.ssm.mapper.SysLogMapper;
import com.ssm.pojo.SysLog;
import com.ssm.service.SysLogService;
import com.ssm.service.commonService.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by 墨殇
 * 2017/12/27.
 * @author Administrator
 */
@Service("sysLogService")
public class SysLogServiceImpl extends CommonService<SysLog> implements SysLogService {
    @Autowired
    private SysLogMapper sysLogMapper;
    @Override
    public SysLog findById(Long id) {
        SysLog sysLog=super.queryById(id);
        return sysLog;
    }

    @Override
    public List<SysLog> queryList(Map<String, Object> map) {
        List<SysLog> list=sysLogMapper.queryList(map);
        return null;
    }

    @Override
    public Integer queryTotal(Map<String, Object> map) {
        return sysLogMapper.queryTotal(map);
    }

    @Override
    public Integer add(SysLog sysLog) {
        Integer count=super.save(sysLog);
        return count;
    }

    @Override
    public Integer update(SysLog sysLog) {
        Integer count=super.updateByIdSelective(sysLog);
        return count;
    }

    @Override
    public Integer delete(Long id) {

        Integer count=super.deleteById(id);
        return count;
    }

    @Override
    public Integer deleteBatch(Long[] ids) {
        Integer count = 0;
       for (Long id:ids){
       count+=delete(id);
       }
       return count;
    }
}
